package com.itheima.es.controller;
import com.itheima.es.entity.PageResult;
import com.itheima.es.entity.QueryPageBean;
import com.itheima.es.entity.Result;
import com.itheima.es.service.SkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("good")
public class SkuFromJdController {
    @Autowired
    private SkuService skuService;

    /**
     * 分页查询数据（词条匹配）
     * @param queryPageBean 查询条件
     * @return 分页查询的结果
     */
    @PostMapping("search")
    public Result search(QueryPageBean queryPageBean){

        PageResult pageResult = skuService.search(queryPageBean);
        return new Result(pageResult);
    }
}
